package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;

import static com.enhe.gck.CarbonRelationType.RR_扣款记录_充值名称_充值记录;

// 扣款记录
@CarbonRecord("hwane16713")
@Data
public class Deduction implements Updatable {
    @JSONField(name = "唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 扣款金额
    @JSONField(name = "扣款金额")
    @Attribute("hwan16715")
    private Double deductionAmount;

    // 是否散户扣款
    @JSONField(name = "是否散户扣款")
    @Attribute("hwan16856")
    private Boolean isRetail;

    // 重量
    @JSONField(name = "重量")
    @Attribute("hwan16874")
    private Double weight;

    // 充值币种扣款
    @JSONField(name = "充值币种扣款")
    @Attribute("hwan17344")
    private Double deductionAmountFinal;

    @JSONField(name="单价")
    @Attribute("hwan25706")
    private BigDecimal unit;
    // 税率
    @JSONField(name="税率")
    @Attribute("hwan25707")
    private BigDecimal taxRate;

    @Relation(RR_扣款记录_充值名称_充值记录)
    private Recharge recharge;

    @Override
    public String getRecordCode() {
        return this.id == null ? null : this.id.toString();
    }
}